3.5.56 \(\int \frac {c+d \sin (e+f x)}{a+a \sin (e+f x)} \, dx\) [456]

Optimal. Leaf size=35 \[ \frac {d x}{a}-\frac {(c-d) \cos (e+f x)}{f (a+a \sin (e+f x))} \]

[Out]

d*x/a-(c-d)*cos(f*x+e)/f/(a+a*sin(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2814, 2727} \begin {gather*} \frac {d x}{a}-\frac {(c-d) \cos (e+f x)}{f (a \sin (e+f x)+a)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*Sin[e + f*x])/(a + a*Sin[e + f*x]),x]

[Out]

(d*x)/a - ((c - d)*Cos[e + f*x])/(f*(a + a*Sin[e + f*x]))

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rubi steps

\begin {align*} \int \frac {c+d \sin (e+f x)}{a+a \sin (e+f x)} \, dx &=\frac {d x}{a}-(-c+d) \int \frac {1}{a+a \sin (e+f x)} \, dx\\ &=\frac {d x}{a}-\frac {(c-d) \cos (e+f x)}{f (a+a \sin (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(79\) vs. \(2(35)=70\).
time = 0.11, size = 79, normalized size = 2.26 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (d (e+f x) \cos \left (\frac {1}{2} (e+f x)\right )+(2 c+d (-2+e+f x)) \sin \left (\frac {1}{2} (e+f x)\right )\right )}{a f (1+\sin (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Sin[e + f*x])/(a + a*Sin[e + f*x]),x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(d*(e + f*x)*Cos[(e + f*x)/2] + (2*c + d*(-2 + e + f*x))*Sin[(e + f*x)/
2]))/(a*f*(1 + Sin[e + f*x]))

________________________________________________________________________________________

Maple [A]
time = 0.25, size = 42, normalized size = 1.20

method result size
derivativedivides \(\frac {-\frac {2 \left (c -d \right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}+2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}\) \(42\)
default \(\frac {-\frac {2 \left (c -d \right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}+2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}\) \(42\)
risch \(\frac {d x}{a}-\frac {2 c}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {2 d}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\) \(54\)
norman \(\frac {\frac {d x}{a}+\frac {d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}+\frac {d x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {d x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}+\frac {\left (2 c -2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {\left (2 c -2 d \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}\) \(134\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*sin(f*x+e))/(a+a*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2/f/a*(-(c-d)/(tan(1/2*f*x+1/2*e)+1)+d*arctan(tan(1/2*f*x+1/2*e)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (37) = 74\).
time = 0.49, size = 84, normalized size = 2.40 \begin {gather*} \frac {2 \, {\left (d {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} - \frac {c}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

2*(d*(arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a + 1/(a + a*sin(f*x + e)/(cos(f*x + e) + 1))) - c/(a + a*sin(f*
x + e)/(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 70, normalized size = 2.00 \begin {gather*} \frac {d f x + {\left (d f x - c + d\right )} \cos \left (f x + e\right ) + {\left (d f x + c - d\right )} \sin \left (f x + e\right ) - c + d}{a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

(d*f*x + (d*f*x - c + d)*cos(f*x + e) + (d*f*x + c - d)*sin(f*x + e) - c + d)/(a*f*cos(f*x + e) + a*f*sin(f*x
+ e) + a*f)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 109 vs. \(2 (26) = 52\).
time = 0.63, size = 109, normalized size = 3.11 \begin {gather*} \begin {cases} - \frac {2 c}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} + \frac {d f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} + \frac {d f x}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} + \frac {2 d}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} & \text {for}\: f \neq 0 \\\frac {x \left (c + d \sin {\left (e \right )}\right )}{a \sin {\left (e \right )} + a} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))/(a+a*sin(f*x+e)),x)

[Out]

Piecewise((-2*c/(a*f*tan(e/2 + f*x/2) + a*f) + d*f*x*tan(e/2 + f*x/2)/(a*f*tan(e/2 + f*x/2) + a*f) + d*f*x/(a*
f*tan(e/2 + f*x/2) + a*f) + 2*d/(a*f*tan(e/2 + f*x/2) + a*f), Ne(f, 0)), (x*(c + d*sin(e))/(a*sin(e) + a), Tru
e))

________________________________________________________________________________________

Giac [A]
time = 0.55, size = 40, normalized size = 1.14 \begin {gather*} \frac {\frac {{\left (f x + e\right )} d}{a} - \frac {2 \, {\left (c - d\right )}}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

((f*x + e)*d/a - 2*(c - d)/(a*(tan(1/2*f*x + 1/2*e) + 1)))/f

________________________________________________________________________________________

Mupad [B]
time = 6.83, size = 35, normalized size = 1.00 \begin {gather*} \frac {d\,x}{a}-\frac {2\,c-2\,d}{a\,f\,\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*sin(e + f*x))/(a + a*sin(e + f*x)),x)

[Out]

(d*x)/a - (2*c - 2*d)/(a*f*(tan(e/2 + (f*x)/2) + 1))

________________________________________________________________________________________